<!DOCTYPE html>
<html lang="zh-hans">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>补字母</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            function addA() {
                const bLi = document.querySelector('.b')
                const aLi = document.createElement('li')
                aLi.innerText = 'A'
                bLi.parentNode.insertBefore(aLi, bLi)
            }

            function addD() {
                const eLi = document.querySelector('.e')
                const dLi = document.createElement('li')
                dLi.innerText = 'D'
                eLi.parentNode.insertBefore(dLi, eLi)
            }
            const aTrigger = document.querySelector('#aTrigger')

            aTrigger.onclick = function() {
                addA()
                addD()
            }
        })
    </script>
</head>

<body>
    <h1>补字母111</h1>
    <img src="http://localhost:3000/chrome.jpg" width="50" />
    <ul>
        <li class="b">B</li>
        <li class="c">C</li>
        <li class="e">E</li>
    </ul>
    <button id="aTrigger">补A</button>
    <button id="dTrigger">补D</button>
</body>

</html>